<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
      function bai() {
        location.href="https://www.baidu.com";
      }
      function bai2() {
        window.open("https://www.baidu.com");
      }
      function fresh() {
        location.reload();
      }
      function lu() {
        let url = location.href;
        alert(url);
      }
    </script>
</head>
<body>
  <input type="button" value="百度当前窗口" onclick="bai()"/><br>
  <input type="button" value="百度新窗口" onclick="bai2()"/><br>
  <input type="button" value="刷新" onclick="fresh()"><br>
  <input type="button" value="获取当前路劲" onclick="lu()"><br>
</body>
</html>